﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace IOA.MES.Client.Common
{
    /// <summary>
    /// WinConfirm.xaml 的交互逻辑
    /// </summary>
    public partial class WinConfirm : Window
    {
        public WinConfirm(string message)
        {
            InitializeComponent();
            txtMessage.Text = message;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Height = txtMessage.ActualHeight + 190;
            btnOK.Focus();
            this.Topmost = true;
        }

        private void btn_Click(object sender, RoutedEventArgs e)
        {
            var btn = sender as Button;
            this.DialogResult = string.Equals(btn.Name, "btnOK", StringComparison.CurrentCultureIgnoreCase);
            this.Close();
        }
    }
}
